#ifndef PHOTOVIEWWIDGET_H
#define PHOTOVIEWWIDGET_H

#include <QWidget>
#include<QLabel>
#include<QPushButton>
#include<QStackedLayout>
#include<QListWidget>
#include<QHBoxLayout>
#include<QCalendarWidget>
#include"contrl/mycontrol.h"
#include"data/image.h"
#include"golob.h"
#include<QDialog>
#include<QShowEvent>
#include<QMessageBox>
class PhotoViewWidget : public QWidget
{
    Q_OBJECT
public:
    explicit PhotoViewWidget(QWidget *parent = nullptr);
    void initUI();


    void SelectDataBase();

    void showEvent(QShowEvent*event);
signals:


    void PhotoToMain();
public slots:

    void showCalender();
    void selectCalender(const QDate &date);

    void loadMoreItems();

    void ClickRetButton();
    void onItemClicked(QListWidgetItem *item);


private:
    QLabel*title;
    QLabel*text;
    QPushButton*date_button;
    QCalendarWidget *calendarWidget;
    QStackedLayout*stackedLayout;
    QListWidget*listWidget;
    QPushButton*more_button;

    QPushButton*ret_button;


    QHBoxLayout*layout_H1;
    QHBoxLayout*layout_H2;
    QHBoxLayout*layout_H3;
    QHBoxLayout*layout_H4;
    QHBoxLayout*layout_H5;

    QVBoxLayout*layout_V;


    QList<Video*> videos;

    MyControl *con;
    BaseModel* model;

    QList<Image*> images;
    QList<Image*> selectimages;

    int index=0;
    int curindex=0;
};

#endif // PHOTOVIEWWIDGET_H
